package com.itheima.controller;

import com.itheima.entity.Account;
import com.itheima.service.AccountService;
import com.itheima.service.impl.AccountServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller
public class AccountController {
    /**
     * required=false  并不常用  还是老老实实提供对象!!!
     * 非得用 记得在业务做判空处理
     */
    @Autowired
    /**
     * 限定名字 概率不高
     */
    @Qualifier("accountService")

    //@Resource(name = "accountService")
    private AccountService accountService;


    public void save(Account account) {

        accountService.save(account);
    }
}
